/*
* Copyright (C) 2023 ~ 2033 Ltd.
*
* Author:     helei <2454264168@qq.com>
*
* Maintainer: helei <2454264168@qq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* General Public License version 3 as published by the Free Software
* Foundation and appearing in the file LICENSE.MIT included in the
* packaging of this file.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef USTYLEOPTION_H
#define USTYLEOPTION_H

#include "utkwidget_export.h"
#include "utkwidgetglobal.h"

#include <QStyleOption>

class UTKWIDGET_EXPORT USettingsItemStyleOption : public QStyleOption
{
public:
    enum StyleOptionType { Type = SO_Default };
    enum StyleOptionVersion { Version = 1 };

    QColor backgroundColor;
    QIcon icon;
    QString text;
    QSize iconSize;
    Qt::LayoutDirection direction;
    QStyleOptionViewItem::ViewItemPosition viewItemPosition;

    USettingsItemStyleOption();
    USettingsItemStyleOption(const USettingsItemStyleOption &other) : QStyleOption(Version, Type)
    {
        *this = other;
    }
    USettingsItemStyleOption &operator=(const USettingsItemStyleOption &) = default;
};


class UTKWIDGET_EXPORT UCommonButtonOption : public QStyleOptionButton
{
public:
    enum ButtonFeature
    {
        PlainButton = (CommandLinkButton << 1),
        DeepButton = (PlainButton << 1),
        LightButton = (DeepButton << 1),
        UCommandLinkButton = (LightButton << 1)
    };

    QColor backgroundColor;
    QColor foregroundColor;
    QColor borderColor;
    int radius;
    RadiuPosition position;
    uint alignment;

    UCommonButtonOption();
};

class UTKWIDGET_EXPORT UTagWidgetStyleOption : public QStyleOption
{
public:
    enum StyleOptionType { Type = SO_Default };
    enum StyleOptionVersion { Version = 1 };

    enum TagFeature
    {
        PlainTag,
        DeepTag,
        LightTag
    };

    QString text;
    TagFeature feature;
    QColor backgroundColor;
    QColor foregroundColor;
    QColor borderColor;
    bool isEdit = false;
    int margins = 6;

    UTagWidgetStyleOption();
    UTagWidgetStyleOption(const UTagWidgetStyleOption &other) : QStyleOption(Version, Type)
    {
        *this = other;
    }
    UTagWidgetStyleOption &operator=(const UTagWidgetStyleOption &) = default;
};

#endif // USTYLEOPTION_H
